import request from "@/utils/request";

export function getCommonDataDict() {
  return request({
    url: "/common/data/dict",
    method: "get"
  });
}

export function getCommonUtilBasicData(params) {
  return request({
    url: "/common/util/basic_data",
    method: "get",
    params
  });
}

export function uploadFile(data) {
  return request({
    url: "/common/uploads/upload",
    method: "post",
    data
  });
}

// 经纬度{ lat, lng }转地址
export function getAddress(params) {
  return request({
    url: "/common/util/geocoder_re",
    method: "get",
    params
  });
}

// 地址{address}转经纬度
export function getLatAndLng(params) {
  return request({
    url: "/common/util/geocoder",
    method: "get",
    params
  });
}

// IP定位
export function getLatAndLngByIp() {
  return request({
    url: "/common/util/ip_location",
    method: "get"
  });
}
